import axios from "./request";
const base = {
  baseUrl: "/api",
  search: "/work.php?action=search",
  getList: "/work.php?action=getList",
  detail: "/work.php?action=detail",
  add: "/work.php?action=add",
  delete: "/work.php?action=delete",
  edit: "/work.php?action=edit"
};
const api = {
  getList(params) {
    return axios.get(base.baseUrl + base.getList, { params: params });
  },
 async search(params) {
    return axios.get(base.baseUrl + base.search, { params: params });
  },
  detail(params) {
    return axios.get(base.baseUrl + base.detail, { params: params });
  },
  add(params) {
    return axios.post(base.baseUrl + base.add, params);
  },
  delete(params) {
    return axios.get(base.baseUrl + base.delete, { params: params });
  },
  edit(params) {
    return axios.post(base.baseUrl + base.edit, params);
  }
  //   getLogin(params) {
  //     return axios.post(base.baseUrl + base.login, params);
  //   },
  //   getMusic(params) {
  //     return axios.get(base.baseUrl + base.music, { params: params });
  //   },
};
export default api;
